﻿using Ruici.BLL;
using Ruici.Web.Services.Model;
using RuiciWebSite.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Mvc;

namespace RuiciWebSite.Controllers
{
    public class NewsDetailController : Controller
    {
        DocumentBll document = new DocumentBll();
        // GET: PersonalCenter
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 新闻内容详情
        /// </summary>
        /// <param name="pageInfo"></param>
        /// <returns></returns>
        [HttpPost]
        public JsonResult GetArticleDetial(PageInfoViewModel pageInfo)
        {
            ArticleResponse artileInfo = document.GetArticleDetial(int.Parse(pageInfo.keyWord));

            if (artileInfo != null)
                return Json(artileInfo, JsonRequestBehavior.AllowGet);

            return Json(new ReturnCode(-1, "没有找到相关文章"), JsonRequestBehavior.AllowGet);
        }
    }
}